import request from '@/utils/request'

//统一字典下拉框查询
export function adminDict(params) {
  return request({
    url: `common/v1/adminDict`,
    method: 'get',
    params
  })
}

// 商家数字权益卡列表
export function getList(query) {
  return request({
    url: '/merchant/lucrative/equity/card/list',
    method: 'post',
    data: query
  })
}

// 商家数字权益卡状态数量
export function getNum(query) {
    return request({
      url: '/merchant/lucrative/equity/card/sell/status',
      method: 'post',
      data: query
    })
}

//商家数字权益卡审核
export function auditCard(data) {
    return request({
      url: '/merchant/lucrative/equity/card/audit',
      method: 'put',
      data
    })
}

//查询勋章卡下拉框
export function equitySelect() {
    return request({
      url: '/merchant/lucrative/equity/card/medal/card/select',
      method: 'get',
    })
}

//标签查询下拉框
export function tagSelect() {
  return request({
    url: '/merchant/lucrative/equity/card/tag/select',
    method: 'get',
  })
}

//查询赚卡标签下拉框
export function addTagSelect() {
  return request({
    url: '/common/v1/card/tag/select',
    method: 'get',
  })
}


//新增商家数字权益卡
export function addCard(data) {
    return request({
      url: '/merchant/lucrative/equity/card',
      method: 'post',
      data
    })
  }

//编辑商家数字权益卡
export function editCard(data) {
    return request({
      url: '/merchant/lucrative/equity/card',
      method: 'put',
      data
    })
}
//修改商家数字权益卡 
export function modifyCard(data) {
  return request({
    url: 'merchant/lucrative/equity/card/modify',    
    method: 'put',
    data
  })
}
// 批量配置运营活动
export function configCard(data) {
    return request({
      url: '/merchant/lucrative/equity/card/batch/incentive',
      method: 'put',
      data
    })
}


//商家数字权益卡详情
export function cardDetail(id) {
  return request({
    url: '/merchant/lucrative/equity/card/detail/' + id,
    method: 'get'
  })
}
//查询勋章卡信息
export function equityDetail(id) {
    return request({
      url: '/merchant/lucrative/equity/card/medal/card/' + id,
      method: 'get'
    })
  }

// 同行助力激励活动列表
export function getAssistanceList(query) {
    return request({
      url: '/merchant/lucrative/equity/card/assistance/list',
      method: 'get',
      params: query
    })
}
// 同行助力激励活动统计
export function assistanceCount(id) {
    return request({
      url: '/merchant/lucrative/equity/card/assistance/count/' + id,
      method: 'get'
    })
}


//消费后激励活动列表
export function getIncentiveList(query) {
    return request({
      url: '/merchant/lucrative/equity/card/incentive/list',
      method: 'post',
      data: query
    })
}
// 消费后激励活动统计
export function incentiveCount(id) {
    return request({
      url: '/merchant/lucrative/equity/card/incentive/count/' + id,
      method: 'get'
    })
}

//消费后激励活动列表
export function orderList(data) {
    return request({
      url: '/merchant/lucrative/equity/card/order/list',
      method: 'post',
      data
    })
}



//持卡会员统计
export function customerCount(params) {
    return request({
      url: '/merchant/equity/card/issue/customer/count',
      method: 'get',
      params
    })
}

//批量修改数字权益卡上下架状态
export function editStatus(data) {
    return request({
      url: '/merchant/lucrative/equity/card/batch/sell/status',
      method: 'put',
      data
    })
}
// 保存默认上架状态（新建）
export function upStatus(data) {
  return request({
    url: '/merchant/lucrative/equity/card/default/up/status',
    method: 'post',
    data
  })
}

//批量设置标签
export function batchTag(data) {
  return request({
    url: '/merchant/lucrative/equity/card/batch/tag',
    method: 'put',
    data
  })
}
//批量增减虚拟销量
export function salesVolume(data) {
  return request({
    url: '/merchant/lucrative/equity/card/batch/virtual/sales/volume',
    method: 'put',
    data
  })
}

// 赚卡订单列表
export function orderListv2(data) {
  return request({
    url: '/merchant/lucrative/equity/card/order/list/v2',
    method: 'post',
    data
  })
}

//查询渠道下拉框
export function channelSelect() {
  return request({
    url: '/merchant/lucrative/equity/card/channel/select',
    method: 'get',
    
  })
}

// 查询赚卡库存信息
export function inventoryInfoId(id) {
  return request({
    url: `/merchant/lucrative/equity/card/inventory/info/${id}`,
    method: 'get'
  })
}
// 更新赚卡库存信息
export function editInventoryInfo(data) {
  return request({
    url: '/merchant/lucrative/equity/card/inventory/info',
    method: 'put',
    data
  })
}

//查询所属店铺下拉框
export function shopSelect() {
  return request({
    url: '/merchant/lucrative/equity/card/shop/limit/select',
    method: 'get',
  })
}

